package cn.innosmart.aq.camera.protocol;

/**
 * Created by davidlin1980 on 12/4/14.
 */
public class BaseError {

    public static final int BASIC_ERROR_NONE = 0;
    public static final int BASIC_ERROR_GENERIC = 1;

    protected int mCode;
    protected String mMessage;

    public BaseError() {
        mCode = 0;
        mMessage = "";
    }

    public BaseError(BaseError error) {
        mCode = error.getCode();
        mMessage = error.getMessage();
    }

    public BaseError(int code, String message) {
        mCode = code;
        mMessage = message;
    }

    public String getMessage() {
        return mMessage;
    }

    public int getCode() {
        return mCode;
    }

    public String toString() {
        return String.format("Error %d: %s", mCode, mMessage);
    }
}
